package com.kaishengit.dao;


import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.kaishengit.pojo.Employee;

@Repository
public class EmployeeDao extends BaseDao<Employee, String>{

	public Employee findByNameAndPwd(Employee employee) {
		String hql = "from Employee where username = ? and password = ?";
		Query query = getSession().createQuery(hql);
		query.setParameter(0, employee.getUsername());
		query.setParameter(1, employee.getPassword());
		return (Employee) query.uniqueResult();
	}

}
